package com.github.pudding.model;

import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

@Data
@ToString
//映射数据库的person
@Document(collection = "person")
public class Person {

    //和数据库objectId映射
    @Id
    private String id;

    //设置索引
    @Indexed
    private String city;
    private String name;
    private int age;
}
